package com.gr3g.dev.learndraw.model.draw;

import android.graphics.Path;

import com.gr3g.dev.learndraw.model.IPath;

/** @author Gregory Tardivel */
public final class Circle implements IPath {

    /** Centre X. */
    private int x;
    /** Centre Y. */
    private int y;
    /** Rayon du cercle. */
    private int radius;
    /** Cercle rempli. */
    private boolean filled;

    /** @return the filled */
    public boolean isFilled() {
        return this.filled;
    }

    /** @param pFilled the filled to set */
    public void setFilled(final boolean pFilled) {
        this.filled = pFilled;
    }

    /** @return the x */
    public int getX() {
        return this.x;
    }

    /** @param pX the x to set */
    public void setX(final int pX) {
        this.x = pX;
    }

    /** @return the y */
    public int getY() {
        return this.y;
    }

    /** @param pY the y to set */
    public void setY(final int pY) {
        this.y = pY;
    }

    /** @return the radius */
    public int getRadius() {
        return this.radius;
    }

    /** @param pRadius the radius to set */
    public void setRadius(final int pRadius) {
        this.radius = pRadius;
    }

    @Override
    public Path getPath(final float width, final float height) {
        final float nRadius = this.radius * width / 100;
        final Path retour = new Path();
        retour.addCircle(this.x * width / 100, this.y * height / 100, nRadius,
                Path.Direction.CW);
        return retour;
    }

    @Override
    public String toString() {
        return "Circle";
    }
}
